home *** CD-ROM | disk | FTP | other *** search
/ Ultra Pack / UltraComputing Partner Applications.iso / SunLabs / tclTK / src / tk4.0 / tests / window.test < prev    next >
Encoding:
Text File  |  1995-03-28  |  2.0 KB  |  62 lines

  1. # This file is a Tcl script to test the procedures in the file
  2. # tkWindow.c.  It is organized in the standard fashion for Tcl tests.
  3. #
  4. # Copyright (c) 1995 Sun Microsystems, Inc.
  5. #
  6. # See the file "license.terms" for information on usage and redistribution
  7. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  8. #
  9. # @(#) window.test 1.1 95/03/28 14:35:58
  10.  
  11. if {[info procs test] != "test"} {
  12.     source defs
  13. }
  14.  
  15. foreach i [winfo children .] {
  16.     destroy $i
  17. }
  18. wm geometry . {}
  19. raise .
  20. update
  21.  
  22. # XXX This file is woefully incomplete.  Right now it only tests
  23. # a few parts of a few procedures in tkWindow.c
  24.  
  25. # Most of the tests below don't produce meaningful results;  they
  26. # will simply dump core if there are bugs.
  27.  
  28. test window-1.1 {Tk_DestroyWindow procedure, destroy handler deletes parent} {
  29.     toplevel .t -width 300 -height 200
  30.     wm geometry .t +0+0
  31.     frame .t.f  -width 200 -height 200 -relief raised -bd 2
  32.     place .t.f -x 0 -y 0
  33.     frame .t.f.f -width 100 -height 100 -relief raised -bd 2
  34.     place .t.f.f -relx 1 -rely 1 -anchor se
  35.     bind .t.f <Destroy> {destroy .t}
  36.     update
  37.     destroy .t.f
  38. } {}
  39. test window-1.2 {Tk_DestroyWindow procedure, destroy handler deletes parent} {
  40.     toplevel .t -width 300 -height 200
  41.     wm geometry .t +0+0
  42.     frame .t.f  -width 200 -height 200 -relief raised -bd 2
  43.     place .t.f -x 0 -y 0
  44.     frame .t.f.f -width 100 -height 100 -relief raised -bd 2
  45.     place .t.f.f -relx 1 -rely 1 -anchor se
  46.     bind .t.f.f <Destroy> {destroy .t}
  47.     update
  48.     destroy .t.f
  49. } {}
  50. test window-1.3 {Tk_DestroyWindow procedure, destroy handler deletes parent} {
  51.     frame .f -width 80 -height 120 -relief raised -bd 2
  52.     place .f -relx 0.5 -rely 0.5 -anchor center
  53.     toplevel .f.t -width 300 -height 200
  54.     wm geometry .f.t +0+0
  55.     frame .f.t.f  -width 200 -height 200 -relief raised -bd 2
  56.     place .f.t.f -x 0 -y 0
  57.     frame .f.t.f.f -width 100 -height 100 -relief raised -bd 2
  58.     place .f.t.f.f -relx 1 -rely 1 -anchor se
  59.     update
  60.     destroy .f
  61. } {}
  62.